Hi,

I've been using a javascript snippet with this module to toggle admin menu visibility. It's pretty small and uses jQuery. Maybe you could add something like this.

Here's the snippet I use, if anyone want to give it a try:

if (Drupal.jsEnabled) {
  Drupal.admin_menu_fix = {
    init: function() {
      $("div#admin-menu").children("ul:first").children("li:gt(0)").hide();
      $("div#admin-menu").width("24px").height("24px").css("overflow","hidden");
      $("img.admin-menu-icon").attr("src","/favicon.ico").css("cursor","pointer").title("Click here to toggle administration menu visibility!");
      $("li.admin-menu-icon:first a:first").css("padding","4px");
      Drupal.admin_menu_fix.is_ready = true;
      Drupal.admin_menu_fix.is_collapsed = true;
      $("li.admin-menu-icon:first a:first").click(function() {
        this.blur();
        if (!Drupal.admin_menu_fix.is_ready) return;
        Drupal.admin_menu_fix.is_ready = false;
        if (Drupal.admin_menu_fix.is_collapsed) {
          $("div#admin-menu").width("100%").css("overflow","visible").children("ul:first").children("li:gt(0)").show();
          Drupal.admin_menu_fix.is_collapsed = false;
        }
        else {
          $("div#admin-menu").width("24px").css("overflow","hidden").children("ul:first").children("li:gt(0)").hide();
          Drupal.admin_menu_fix.is_collapsed = true;
        }
        Drupal.admin_menu_fix.is_ready = true;
        return false;
      });
    }
  };
  $(document).ready(Drupal.admin_menu_fix.init);
}

As it is, just place into any .js file, i.e. admin_menu_toggle.js and then something like the following in your page.tpl.php script.

<?php if (user_access('access administration menu')) : ?>
<script type="text/javascript" src="<?=base_path() . path_to_theme()?>/js/admin_menu_toggle.js"></script>
<?php endif; ?>

Adjust path to suit your needs.

Cheers

Comments

sun’s picture

Project: Administration menu » Admin Menu Hider
Version: 5.x-2.x-dev » 5.x-1.x-dev

I think this feature request is more appropriate for the Administration Menu Dropdown enhancement module. Thus, moving over there.

deciphered’s picture

Assigned: Unassigned » deciphered

Looking into this as a secondary mode.

deciphered’s picture

Title: Toggle admin menu with javascript » New behavior for Admin Menu Dropdown
Status: Active » Fixed

New behavior added to 5.x-2.x-dev and 6.x-2.x-dev which should be available shortly.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.